package com.zhoutao123.hephaestus.object.bussiness;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zhoutao123.hephaestus.repository.entity.BlogLook;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VBlogLook  implements Serializable {

  private String blogId;

  private String userIp;

  private Date lookTime;

  private Date createTime;

  private Date updateTime;

  public static VBlogLook of(BlogLook blogLook) {
    return new VBlogLook()
        .setBlogId(blogLook.getBlogId())
        .setUserIp(blogLook.getUserIp())
        .setLookTime(blogLook.getLookTime())
        .setCreateTime(blogLook.getCreateTime())
        .setUpdateTime(blogLook.getUpdateTime());
  }
}
